package com.example.demo.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.demo.dao.ProductDao;
import com.example.demo.model.Product;
import com.example.demo.service.ProductService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class ProductServiceimpl extends ServiceImpl<ProductDao, Product> implements ProductService {

    @Resource
    ProductDao productDao;

    @Override
    public Product findById(Integer pid) {
        Product product=productDao.findById(pid);
        return product;
    }

    @Override
    public void addProduct(Product product) {
        productDao.insertProduct(product);
    }


}
